package com.example.elm_server_api.domain;

import java.io.Serializable;
import lombok.Data;

/**
 * 订单--评论
 * @TableName order_comment
 */
@Data
public class OrderComment implements Serializable {
    /**
     * 主键
     */
    private Integer id;

    /**
     * 订单ID
     */
    private String orderId;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 用户评价
     */
    private String desc;

    /**
     * 评论时间
     */
    private Integer addTime;

    /**
     * 评价状态(已/待)
     */
    private Integer status;

    /**
     * 评价等级(1、2、3、4、5)
     */
    private Integer commentGrade;

    /**
     * 评价状态(匿名[1]/实名[0])
     */
    private Integer statusUser;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrderComment other = (OrderComment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCommentGrade() == null ? other.getCommentGrade() == null : this.getCommentGrade().equals(other.getCommentGrade()))
            && (this.getStatusUser() == null ? other.getStatusUser() == null : this.getStatusUser().equals(other.getStatusUser()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCommentGrade() == null) ? 0 : getCommentGrade().hashCode());
        result = prime * result + ((getStatusUser() == null) ? 0 : getStatusUser().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", userId=").append(userId);
        sb.append(", desc=").append(desc);
        sb.append(", addTime=").append(addTime);
        sb.append(", status=").append(status);
        sb.append(", commentGrade=").append(commentGrade);
        sb.append(", statusUser=").append(statusUser);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}